<template>
	<view>
		<!-- status：1：待付款; 2:待核销；3:待发货；4：待收货；5：待评价 6:待配送-->
		<view class="one u-auto u-flex">
			<view class="u-p-l-100" v-if="1>2">
				<!-- 待付款 -->
				<u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img4.png' width='76rpx' height='76rpx'
					v-if="userinfo.status==0">
				</u-image>
				<!-- 待核销 -->
				<u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img31.png' width='76rpx' height='76rpx'
					v-if="userinfo.status==2"></u-image>
				<!-- 待发货 -->
				<u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img4.png' width='76rpx' height='76rpx'
					v-if="userinfo.status==3"></u-image>
				<!-- 待收货 -->
				<u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img4.png' width='76rpx' height='76rpx'
					v-if="userinfo.status==4"></u-image>
				<!-- 待评价 -->
				<u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img25.png' width='76rpx' height='76rpx'
					v-if="userinfo.status==5"></u-image>
				<!-- 待评价 -->
				<u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img28.png' width='76rpx' height='76rpx'
					v-if="userinfo.status==6"></u-image>
			</view>
			<view class="u-p-l-30 cl_FFF">
				<view class="" v-if="userinfo.status==0">待支付</view>
				<view class="" v-if="userinfo.status==2">待核销</view>
				<view class="" v-if="userinfo.status==3">待发货</view>
				<view class="" v-if="userinfo.status==4">待收货</view>
				<view class="" v-if="userinfo.status==5">待评价</view>
				<view class="" v-if="userinfo.status==6">已完成</view>
				<view class="u-m-t-10 u-font-20">订单时间:{{userinfo.create_time}}</view>
				<view class="u-m-t-10 u-font-20">订单编号:{{userinfo.order_sn}}</view>
			</view>
		</view>
		<!-- 收货人信息 -->
		<view class="u-p-30" v-if="userinfo.status!=2">
			<view class="bg_FFFFFF u-p-20 u-b-r-16">
				<view class="u-flex u-row-between u-p-b-20">
					<view class="u-weight">收货人信息</view>
					<view class="u-flex" @click="copy">
						<view class="u-font-24 u-m-l-10" style="color: #FF5502;">复制信息</view>
					</view>
					<!-- <view v-if="userinfo.status==0|| userinfo.status==1" class="u-b-r-10 u-w-150 u-l-h-54 u-h-54 u-font-24 u-text-center"
						style="border: 1rpx solid #FC3533;color: #FC3533;" @click="show1=true">修改地址</view> -->
				</view>
				<view class="u-flex">
					<view class="u-flex">
						<view class="">收货人:</view>
						<view class="u-m-l-20">{{userinfo.addressee_name}}</view>
					</view>
					<view class="u-flex u-m-l-30">
						<view class="">电话:</view>
						<view class="u-m-l-20">{{userinfo.addressee_telphone}}</view>
					</view>
				</view>
				<view class="u-m-t-20 u-l-h-48 u-p-b-20" style="border-bottom: 1rpx solid #F4F1F1;">{{userinfo.address}}
				</view>
			</view>
		</view>
		<view class="u-p-30" v-else>
			<view class="bg_FFFFFF u-p-20 u-font-28 u-b-r-16">
				<view class="u-flex">
					<view class="">店铺名称:</view>
					<view class="u-m-l-20">{{userinfo.shop_name}}</view>
				</view>
				<view class="u-flex u-m-t-10">
					<view class="">店铺电话:</view>
					<view class="u-m-l-20">{{userinfo.shop_mobile}}</view>
				</view>
				<view class="u-m-t-10">
					<view class="">店铺地址:</view>
					<view class="u-m-t-10">{{userinfo.shop_address}}</view>
				</view>
			</view>
		</view>


		<view class="u-p-30">
			<view class="u-p-20 u-b-r-16 bg_FFFFFF">
				<view class="u-flex u-p-20" style="border-bottom: 1rpx solid #F4F1F1;">
					<u-image :src='userinfo.shop_logo' width='36rpx' height='36rpx'></u-image>
					<view class="u-p-l-10 u-weight u-h-36">{{userinfo.shop_name}}</view>
				</view>
				<view class="u-p-20 u-flex u-row-between" style="border-bottom: 1rpx solid #F4F1F1;"
					v-for="(item,index) in userinfo.item" :key="index"
					@click="$u.route(`/pages/home/paymassage?num=${item.spu}`)">
					<view class="u-flex">
						<view class="">
							<u-image :src='item.imgs[0]' width='183rpx' height='183rpx'></u-image>
						</view>
						<view class="u-p-l-10 ">
							<view class="u-weight">{{item.goods_name}}</view>
							<!-- <view class="u-weight u-p-t-10">可口30克*12枚</view> -->
							<view class="u-font-20  u-m-t-10"
								style="background-color: #F8F8F8; color: #68615F;padding: 3rpx 6rpx;display: inline-block;">
								{{item.spece_value_id}}
							</view>
							<view class="u-flex u-row-between u-w-400">
								<view class=" u-p-t-10" style="color: #FC3533;">￥{{item.price}}</view>
								<view class="u-font-28" style="color:#454545;">{{item.num}}</view>
							</view>

						</view>

					</view>

				</view>
				<view v-if="userinfo.reward_score!=0" class="u-m-t-20 u-flex u-row-between">
					<view class="">奖励积分</view>
					<view class="u-flex">
						<u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img5.png' width='28rpx' height='28rpx'>
						</u-image>
						<view class="u-weight">{{userinfo.reward_score}}</view>
					</view>
				</view>
				<view v-if="userinfo.score_amount!='0.00'" class="u-m-t-20 u-flex u-row-between">
					<view class="">积分抵扣</view>
					<view class="u-weight">{{userinfo.score_amount}}元</view>
				</view>
			</view>
		</view>
		<view class="" style="padding:30rpx;">
			<view class="bg_FFFFFF u-p-20 u-b-r-16">
				<view class="u-m-t-20 u-flex u-row-between">
					<view class="">备注：</view>
					<view class="u-weight">{{userinfo.note}}</view>
				</view>
				<view class="u-m-t-20 u-flex u-row-between">
					<view class="">运费</view>
					<view class="u-weight">{{userinfo.delivery_amount}}</view>
				</view>
				<view class="u-m-t-20 u-flex u-row-between">
					<view class="">奖励积分</view>
					<view class="u-flex">
						<u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img5.png' width='28rpx' height='28rpx'></u-image>
						<view class="u-weight">{{userinfo.reward_score}}</view>
					</view>
				</view>
				<view class="u-m-t-20 u-flex u-row-between">
					<view class="">抵扣金抵扣</view>
					<view class="u-weight">{{userinfo.deduct_amount}}元</view>
				</view>
				<view class="u-m-t-20 u-flex u-row-between">
					<view class="">优惠券抵扣</view>
					<view class="u-weight">{{userinfo.coupon_amount}}元</view>
				</view>
				<view class="u-m-t-20 u-flex u-row-between">
					<view class="">实付金额</view>
					<view class="u-weight">{{userinfo.pay_amount}}元</view>
				</view>
				<view class="u-m-t-20 u-flex u-row-between">
					<view class="">总金额</view>
					<view class="u-weight">{{userinfo.total_amount}}元</view>
				</view>
			</view>
		</view>
		<view class="" style="padding:30rpx;">
			<view class="bg_FFFFFF u-p-20 u-b-r-16">
				<view class="u-weight u-font-30">订单详情</view>
				<view class="u-m-t-20 u-flex" style="color: #68615F;">
					<view class="">发货方式：</view>
					<view class="u-m-l-20">{{userinfo.transport_type==2?'到店自提':'邮寄发货'}}</view>
				</view>
				<view class="u-m-t-20 u-flex" style="color: #68615F;">
					<view class="">订单编号:</view>
					<view class="u-m-l-20">{{userinfo.order_sn}}</view>
				</view>
				<view class="u-m-t-20 u-flex" style="color: #68615F;">
					<view class="">支付交易号</view>
					<view class="u-m-l-20">{{userinfo.order_sn}}</view>
				</view>
				<view class="u-m-t-20 u-flex" style="color: #68615F;">
					<view class="">支付时间：</view>
					<view class="u-m-l-20">{{userinfo.pay_time}}</view>
				</view>
				<view v-if="userinfo.pay_type" class="u-m-t-20 u-flex" style="color: #68615F;">
					<view class="">支付方式：</view>
					<view class="u-m-l-20">{{userinfo.pay_type}}
					</view>
				</view>
				<view class="u-m-t-20 u-flex" style="color: #68615F;">
					<view class="">创建时间：</view>
					<view class="u-m-l-20">{{userinfo.create_time}}</view>
				</view>
				<view v-if="userinfo.complete_time" class="u-m-t-20 u-flex" style="color: #68615F;">
					<view class="">收货时间：</view>
					<view class="u-m-l-20">{{userinfo.complete_time}}</view>
				</view>
				<view v-if="userinfo.send_time" class="u-m-t-20 u-flex" style="color: #68615F;">
					<view class="">发货时间：</view>
					<view class="u-m-l-20">{{userinfo.send_time}}</view>
				</view>
			</view>
		</view>
		<view v-if="1>2" class="u-fix u-b-0 bg_FFFFFF  u-w-750" style="padding: 30rpx 20rpx;">
			<u-row justify='end'>
				<u-col :span='4' v-if="userinfo.status==0||userinfo.status==3||userinfo.status==2">
					<view class="u-b-r-10   u-w-210 u-l-h-90 u-h-90 u-font-30 u-text-center"
						style="border: 1rpx solid #FC3533;color: #FC3533;" @click="show=true">取消订单</view>
				</u-col>
				<u-col :span='4' v-if="userinfo.status==0">
					<view class="u-b-r-10  u-w-210 u-l-h-90 u-h-90 u-font-30 u-text-center cl_FFF"
						style="background-color: #FC3533;" @click="show7=true">立即支付</view>
				</u-col>
				<u-col :span='4' v-if="userinfo.status==2">
					<view class="u-b-r-10  u-w-210 u-l-h-90 u-h-90 u-font-30 u-text-center cl_FFF"
						style="background-color: #FC3533;" @click="show4=true">查看二维码</view>
				</u-col>
				<u-col :span='4' v-if="userinfo.status==3">
					<view class="u-b-r-10  u-w-210 u-l-h-90 u-h-90 u-font-30 u-text-center cl_FFF"
						style="background-color: #FC3533;" @click="must_saves">催发货</view>
				</u-col>
				<u-col :span='4' v-if="userinfo.status==4||userinfo.status==5||userinfo.status==6">
					<view class="u-b-r-10   u-w-210 u-l-h-90 u-h-90 u-font-30 u-text-center"
						style="border: 1rpx solid #FC3533;color: #FC3533;" @click="show2=true">申请售后</view>
				</u-col>
				<u-col :span='4' v-if="userinfo.status==5">
					<view class="u-b-r-10   u-w-210 u-l-h-90 u-h-90 u-font-30 u-text-center"
						style="border: 1rpx solid #FC3533;color: #FC3533;" @click="show3=true">查看发票</view>
				</u-col>
				<u-col :span='4' v-if="userinfo.status==4||userinfo.status==6">
					<view class="u-b-r-10   u-w-210 u-l-h-90 u-h-90 u-font-30 u-text-center"
						style="border: 1rpx solid #FC3533;color: #FC3533;"
						@click="$u.route('/subcontract/originalprice/Invoicing/Invoicing')">申请开票</view>
				</u-col>
				<u-col :span='4' v-if="userinfo.status==4||userinfo.status==6">
					<view class="u-b-r-10  u-w-210 u-l-h-90 u-h-90 u-font-30 u-text-center cl_FFF"
						style="background-color: #FC3533;" @click="show5=true">确认收货</view>
				</u-col>
				<u-col :span='4' v-if="userinfo.status==5">
					<view class="u-b-r-10  u-w-210 u-l-h-90 u-h-90 u-font-30 u-text-center cl_FFF"
						style="background-color: #FC3533;" @click="$u.route('/subcontract/originalprice/evaluate/evaluate')">去评价
					</view>
				</u-col>
			</u-row>
		</view>


		<!-- 取消订单 -->
		<u-picker mode="selector" v-model="show" :default-selector="[0]" :range="no_lick_list"
			@confirm='true_remove_good'></u-picker>
		<!-- 修改地址 -->
		<u-mask :show="show1">
			<view class="u-w-600 u-b-r-20 bg_FFFFFF u-p-30 u-auto " style="margin-top: 200rpx;">

				<view class="u-flex u-row-between">
					<view>修改收货地址</view>
					<view class="" style="color: blue;" @click="$u.route('/pages/address/addressAll?num=1')">添加新地址
					</view>
				</view>

				<view class="u-p-30 u-m-t-30 u-b-r-20" @click="choes(item)" :class="num==item.id?'bgc1':'bgc'"
					v-for='(item,index) in address_list' :key="item.id">
					<view class="u-flex u-row-between ">
						<view class="">收货人:{{item.name}}</view>
						<view class="">{{item.phone}}</view>
					</view>

					<view class="u-m-t-10 u-font-20 u-p-b-20">{{item.addr}}</view>

					<view class="u-p-t-20 u-flex u-row-between" style="border-top: 1rpx solid #D7D7D7;">
						<view class="u-flex" v-if="item.is_default==1">
							<u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img7.png' width='28rpx' height='28rpx'>
							</u-image>
							<view class="u-m-l-10 u-font-20">默认地址</view>
						</view>
						<view class="" v-else></view>

					</view>
				</view>

				<view class="u-m-t-50 u-flex u-row-between">
					<view class="u-b-r-10 u-w-150 u-l-h-54 u-h-54 u-font-24 u-text-center" style="border: 1rpx solid blue;"
						@click="show1=false">取消</view>
					<view class="u-b-r-10 u-w-150 u-l-h-54 u-h-54 u-font-24 u-text-center"
						style="border: 1rpx solid #FC3533;color: #FC3533;" @click="true_change_address">确定</view>
				</view>
			</view>
		</u-mask>

		<!-- 申请售后 -->
		<u-mask :show="show2" @click='show2=false'>
			<view class="u-w-600 u-b-r-20 bg_FFFFFF u-p-30 u-auto " style="margin-top: 300rpx;">

				<view class="u-flex u-row-between u-p-b-40" style="border-bottom: 1rpx solid #DFDFDF;">
					<view class="">我要退款(未收到货)</view>
					<view class="" @click="$u.route('/subcontract/originalprice/returngoods/returngoods?num=1')">
						<u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img7.png' width='28rpx' height='28rpx'>
						</u-image>
						<!-- <u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img23.png' width='28rpx' height='28rpx'></u-image> -->
					</view>
				</view>

				<view class="u-flex u-row-between u-m-t-30">
					<view class="">我要退款(未收到货)</view>
					<view class="" @click="$u.route('/subcontract/originalprice/returngoods/returngoods?num=2')">
						<u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img7.png' width='28rpx' height='28rpx'>
						</u-image>
						<!-- <u-image src='https://www.sqkjkj.vip/wxImg/orderlist/img23.png' width='28rpx' height='28rpx'></u-image> -->
					</view>
				</view>
			</view>
		</u-mask>
		<!-- 查看发票 -->
		<u-mask :show="show3">
			<view class="u-p-30">
				<view class="bg_FFFFFF u-b-r-20 u-auto u-m-t-200 u-p-20">
					<view class="u-flex u-row-center u-p-t-50">
						<view class="u-h-30">
							<u-image src='https://www.sqkjkj.vip/wxImg/mybag/img6.png' width='15rpx' height='22rpx'>
							</u-image>
						</view>

						<view class="" style="padding: 0 20rpx;">查看发票</view>
						<view class="u-h-30 u-weight">
							<u-image src='https://www.sqkjkj.vip/wxImg/mybag/img6.png' width='15rpx' height='22rpx'>
							</u-image>
						</view>
					</view>


					<view class="u-m-l-40 u-m-t-70 u-w-600 u-flex-col u-col-center">
						<u-image src='https://www.sqkjkj.vip/wxImg/common/img/zz.jpg' width='466rpx' height='316rpx'>
						</u-image>
					</view>



					<view @click="saves" class="u-w-460 u-auto u-m-t-30 u-b-r-20 u-h-94 u-text-center u-l-h-94 cl_FFF"
						style="background-color:#FC3533 ;">保存图片</view>

				</view>

				<view class="error" @click="show3 = false" style="margin-left: 300rpx;">
					<!-- <u-image src="https://www.sqkjkj.vip/wxImg/common/home/img12.png" mode="aspectFill" width="74rpx" height='160rpx'></u-image> -->
				</view>
			</view>

		</u-mask>
		<!-- 待核销 -->
		<u-mask :show="show4">
			<view class="ones u-auto u-m-t-130 u-p-20">
				<view class="u-flex u-row-center u-p-t-50">
					<view class="u-h-30">
						<u-image src='https://www.sqkjkj.vip/wxImg/mybag/img6.png' width='15rpx' height='22rpx'>
						</u-image>
					</view>

					<view class="" style="padding: 0 20rpx;">查看二维码</view>
					<view class="u-h-30 u-weight">
						<u-image src='https://www.sqkjkj.vip/wxImg/mybag/img6.png' width='15rpx' height='22rpx'>
						</u-image>
					</view>
				</view>

				<view class="u-m-t-60 u-font-20 u-text-center" style="color: #454545;">核销码</view>
				<view class="u-m-t-60 u-font-40 u-weight u-text-center" style="color: #454545;">NKF51515</view>
				<view class="u-h-314 u-m-t-20 u-auto u-w-314 u-b-r-6 u-p-10" style="border: 3rpx solid #FB772D;">
					<view class="u-m-l-10 u-m-t-10">
						<u-image src='https://www.sqkjkj.vip/wxImg/common/img/zz.jpg' width='266rpx' height='266rpx'>
						</u-image>
					</view>

				</view>

				<view @click="saves" class="u-w-460 u-auto u-m-t-30 u-b-r-20 u-h-94 u-text-center u-l-h-94 cl_FFF"
					style="background-color:#FC3533 ;">保存图片</view>

			</view>

			<view class="error" @click="show4 = false" style="margin-left: 350rpx;">
				<!-- <u-image src="https://www.sqkjkj.vip/wxImg/common/home/img12.png" mode="aspectFill" width="74rpx" height='160rpx'></u-image> -->
			</view>
		</u-mask>

		<!-- 确认收货 -->
		<u-mask :show="show5">
			<view class="u-w-600 u-auto u-m-t-160">
				<view class="u-abso" style="left: 400rpx;top: 250rpx;">
					<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/spc.png" mode="aspectFill" width="216rpx"
						height='274rpx'>
					</u-image>
				</view>
				<view class=" u-p-30 bg_FFFFFF u-b-r-16" style="margin-top: 400rpx;">
					<view class="u-font-50 u-weight">确认收货</view>


					<view class="">
						<view class="u-p-t-30 u-font-20">取消订单请确认以下信息</view>
						<view class="u-p-t-20 u-font-20 u-l-h-48">
							结束订单后该订单不予退款，发放实付金额
							相等的积分+获取到的贡献值X50%至积分
							账户中
						</view>

					</view>
					<view class="u-flex u-m-t-20">
						<view @click="show5=false" class="u-w-200 u-m-t-20 u-h-92 u-l-h-92 u-font-30 u-text-center u-auto  u-b-r-20"
							style="background-color: #FFEAEAFF;color: #FC3533FF;">取消</view>

						<view @click="true_get_good"
							class="u-w-200 u-m-t-20 u-h-92 u-l-h-92 u-font-30 u-text-center u-auto cl_FFF u-b-r-20"
							style="background-color: #FC3533FF;">确认</view>

					</view>

				</view>
			</view>

		</u-mask>
		<!-- 支付方式 -->
		<u-popup v-model="show7" mode="bottom">
			<view class="bg_FFFFFF u-b-r-12">
				<view class="u-flex u-row-between u-p-30" style="border-bottom: 1rpx solid #F6F6F6FF;">
					<view class="u-flex">
						<view class=" u-flex">
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/card.png" mode="aspectFill" width="50rpx"
								height='50rpx'>
							</u-image>
							<view class="u-m-l-30 u-font-28 ">钱包支付</view>
						</view>
						<!-- <view class="u-m-l-30 cl_898989FF u-font-24">可用<text class="cl_FB473CFF">￥{{yu.user_wallet}}</text></view> -->
					</view>
					<view class="u-flex">
						<!-- <view class="u-m-r-20 cl_FB473CFF">-￥{{userinfo.goods_amount}}</view> -->
						<view class="" @click="pays='deposit'">
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/c1.png" mode="aspectFill" width="30rpx"
								height='30rpx' v-if="pays=='deposit'"></u-image>
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/c.png" mode="aspectFill" width="30rpx"
								height='30rpx' v-else>
							</u-image>
						</view>
					</view>

				</view>

				<view @click="openEpayDialog" class="u-flex u-row-between u-p-30" style="border-bottom: 1rpx solid #F6F6F6FF;">
					<view class="">
						<view class=" u-flex">
							<u-image src="http://xcx.itcwc.com/wxImg/5dcf4786109a5.png" mode="aspectFill" width="50rpx" height='50rpx'>
							</u-image>
							<view class="u-m-l-30 u-font-28">易支付</view>
						</view>

					</view>
					<view class="u-flex">
						<!-- <view class="u-m-r-20 cl_FB473CFF">-￥{{userinfo.goods_amount}}</view> -->
						<view class="">
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/c1.png" mode="aspectFill" width="30rpx"
								height='30rpx' v-if="pays == 'epay'"></u-image>
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/c.png" mode="aspectFill" width="30rpx"
								height='30rpx' v-else>
							</u-image>
						</view>
					</view>
				</view>

				<view class="u-flex u-row-between u-p-30" style="border-bottom: 1rpx solid #F6F6F6FF;">
					<view class="">
						<view class=" u-flex">
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/wx.png" mode="aspectFill" width="50rpx"
								height='50rpx'>
							</u-image>
							<view class="u-m-l-30 u-font-28 ">微信支付</view>
						</view>

					</view>
					<view class="u-flex">
						<!-- <view class="u-m-r-20 cl_FB473CFF">-￥{{userinfo.goods_amount}}</view> -->
						<view class="" @click="pays='wechat'">
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/c1.png" mode="aspectFill" width="30rpx"
								height='30rpx' v-if="pays=='wechat'"></u-image>
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/c.png" mode="aspectFill" width="30rpx"
								height='30rpx' v-else>
							</u-image>
						</view>

					</view>

				</view>

				<view class="u-flex u-row-between u-p-30" style="border-bottom: 1rpx solid #F6F6F6FF;">
					<view class="">
						<view class=" u-flex">
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/zf.png" mode="aspectFill" width="50rpx"
								height='50rpx'>
							</u-image>
							<view class="u-m-l-30 u-font-28 ">支付宝支付</view>
						</view>

					</view>
					<view class="u-flex">
						<!-- <view class="u-m-r-20 cl_FB473CFF">-￥{{userinfo.goods_amount}}</view> -->
						<view class="" @click="pays='alipay'">
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/c1.png" mode="aspectFill" width="30rpx"
								height='30rpx' v-if="pays=='alipay'"></u-image>
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/c.png" mode="aspectFill" width="30rpx"
								height='30rpx' v-else>
							</u-image>
						</view>
					</view>

				</view>

			</view>

			<!-- 立即支付 -->
			<view class=" u-h-120 u-w-750 bg_FFFFFF">
				<!-- <view class=" u-w-640 u-h-98 u-text-center">提交</view> -->
				<view @click="true_pays" class="u-w-640 u-auto u-h-98 bl2C_3F u-l-h-98 u-text-center u-b-r-20 u-auto"
					style="letter-spacing: 4rpx;color: #ffffff;">立即支付</view>
			</view>
		</u-popup>
		<u-popup v-model="shows" mode='center'>
			<view class="u-p-30 u-h-200">
				<u-message-input :focus="true" :maxlength='6' @finish="finish"></u-message-input>
			</view>

		</u-popup>

		<!-- 易支付选择弹窗 -->
		<u-popup v-model="showEpayDialog" mode="center" width="80%" border-radius="10">
			<view class="epay-dialog">
				<view class="epay-dialog-title">请选择支付方式</view>
				<view class="epay-dialog-content">
					<view class="epay-payment-option" @click="selectEpayMethod('wxpay')">
						<view class="radio-button">
							<view class="radio-inner" :class="{ 'radio-selected': epayParams.epay_type === 'wxpay' }"></view>
						</view>
						<view class="payment-icon">
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/wx.png" mode="aspectFill" width="40rpx"
								height='40rpx'></u-image>
						</view>
						<view class="payment-name">微信支付</view>
					</view>
					<!-- 在微信小程序环境下不显示支付宝支付选项 -->
					<view class="epay-payment-option" @click="selectEpayMethod('alipay')" v-if="!isWechatMP">
						<view class="radio-button">
							<view class="radio-inner" :class="{ 'radio-selected': epayParams.epay_type === 'alipay' }"></view>
						</view>
						<view class="payment-icon">
							<u-image src="https://www.sqkjkj.vip/wxImg/common/shop/zf.png" mode="aspectFill" width="40rpx"
								height='40rpx'></u-image>
						</view>
						<view class="payment-name">支付宝支付</view>
					</view>
				</view>
				<view class="epay-dialog-footer">
					<view class="epay-dialog-btn cancel-btn" @click="showEpayDialog = false">取消</view>
					<view class="epay-dialog-btn confirm-btn" @click="confirmEpayMethod">确定</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
export default {
	data() {
		return {
			// 订单状态
			status: '',
			// 备注信息
			massage: '',
			// 点击取消订单
			show: false,
			order_id: '',
			no_lick_list: [],
			// 修改地址弹窗
			show1: false,
			address_list: [],
			// 是否为默认地址
			num: 0,
			// 申请售后
			show2: false,
			// 查看发票
			show3: false,
			// 待核销
			show4: false,
			// 确认收货
			show5: false,
			userinfo: '',
			timestamp: '86400',
			pays: '',
			show7: false,
			shows: false,
			// 易支付相关
			showEpayDialog: false,
			isWechatMP: false,
			epayParams: {
				epay_type: 'wxpay',
				method: '',
			}
		}
	},
	onLoad(obj) {
		console.log(obj);
		this.status = obj.num
		console.log(this.status);
		this.massage_detail()
		// 获取取消原因
		this.no_licks()
		// 获取地址
		this.changeaddress()
		// 检测设备类型
		this.detectDeviceType()
	},
	methods: {
		massage_detail() {
			this.$api.people_pay_list_detal({
				order_sn: this.status
			}, res => {
				this.userinfo = res.data.data
			})
		},
		// 修改地址弹窗
		changeaddress() {
			this.$api.my_address_list({
				page: 1,
				page_size: 20
			}, res => {
				if (res.data.code == 1) {
					this.address_list = res.data.data.data
					for (var i = 0; i < this.address_list.length; i++) {
						let arr = this.address_list[i].modify_region.name
						if (this.address_list[i].is_default == 1) {
							this.num = this.address_list[i].id
						}
						arr = arr.split('/')
						this.address_list[i].modify_region.name = arr[0] + arr[1] + arr[2] + '-' + this
							.address_list[i].addr
						this.address_list[i].addr = this.address_list[i].modify_region.name

					}
				}
			})
		},
		// 点击切换地址
		choes(item) {
			console.log(item);
			this.num = item.id
			this.userinfo.address_id = item.id
			console.log(this.userinfo);
			this.userinfo.address = item.addr
			this.userinfo.addressee_name = item.name
			this.userinfo.addressee_telphone = item.phone

		},
		// 点击确定更换地址
		true_change_address() {
			this.$api.true_change_my_address({
				order_id: this.userinfo.id,
				dress_id: this.userinfo.dress_id
			}, res => {
				console.log(res);
				if (res.data.code == 1) {
					uni.showToast({
						icon: 'none',
						title: '修改成功'
					})
					this.show1 = false
				} else {
					uni.showToast({
						icon: 'none',
						title: res.data.msg
					})
				}
			})
		},
		//取消原因弹窗
		no_licks() {
			this.$api.get_good_get({}, res => {
				console.log(res);
				this.no_lick_list = res.data.data
			})
		},


		// 点击确定取消按钮
		true_remove_good(e) {
			console.log(e);
			// let arr=
			console.log(this.no_lick_list[e[0]]);
			this.$api.remove_pay_list_detal({
				order_id: this.userinfo.id,
				order_cancel_cause: this.no_lick_list[e[0]],
				remark_reason: ''
			}, res => {
				console.log(res);
				if (res.data.code == 1) {
					uni.showToast({
						icon: 'success',
						title: '取消成功'
					})
					this.massage_detail()
					setTimeout(() => {
						uni.navigateBack()
					}, 500)
					// this.show5 = false
				} else {
					uni.showToast({
						icon: 'error',
						title: res.data.msg
					})
				}
			})
		},

		// 点击催发货
		must_saves() {
			this.$api.must_save({
				order_id: this.userinfo.id
			}, res => {
				if (res.data.code == 1) {
					uni.showToast({
						icon: 'none',
						title: '已通知商家，尽快发货'
					})
				} else {
					uni.showToast({
						icon: 'none',
						title: res.data.msg
					})
				}
			})
		},
		// 余额支付密码弹窗
		true_pays() {
			if (this.pays == 'deposit') {
				this.pay();
			}

			if (this.pays == 'epay') {
				let epayParams = {
					target_id: this.userinfo.target_id,
					target_type: 'order',
					pay_type: this.pays,
					type: this.epayParams.epay_type,
					method: this.epayParams.method,
					trade_pwd: e
				}
				this.$com.easyPay(epayParams, this.pays);
			}
		},

		// 密码输入完调取下单接口
		finish(e) {
			console.log('输入结束，当前值为：' + e);
			this.pay(e)
			this.shows = false
		},
		// 拉取支付
		pay(obj = '') {
			uni.showLoading({
				title: '支付中',
				mask: true
			});
			this.$api.go_pay({
				target_id: this.userinfo.target_id,
				target_type: 'order',
				pay_type: this.pays,
				client: "APP",
				trade_pwd: obj
			}, res => {
				uni.hideLoading();
				console.log(res);
				if (res.data.code == 1) {

					uni.showToast({
						icon: 'success',
						title: '支付成功'
					})
					setTimeout(() => {
						uni.switchTab({
							url: '/pages/my/my'
						})
					}, 500)

				} else {
					uni.showToast({
						icon: 'none',
						title: res.data.msg
					})
				}
			})
		},
		// 保存图片
		saves() {

		},
		// 点击确认收货
		true_get_good() {
			this.$api.true_pay_list_detal({
				order_id: this.userinfo.id
			}, res => {
				if (res.data.code == 1) {
					uni.showToast({
						icon: 'success',
						title: '收货成功'
					})
					this.massage_detail()
					this.show5 = false
				} else {
					uni.showToast({
						icon: 'error',
						title: res.data.msg
					})
				}
			})
		},
		// 点击复制
		copy() {
			uni.setClipboardData({
				data: `${this.userinfo.addressee_name} ${this.userinfo.addressee_telphone} ${this.userinfo.address}`,
				success: function () {
					console.log('success');
				}
			});
		},
		// 易支付相关方法
		// 打开易支付弹窗
		openEpayDialog() {
			this.pays = 'epay'
			this.showEpayDialog = true
		},
		// 选择易支付方式
		selectEpayMethod(method) {
			this.epayParams.epay_type = method
		},
		// 确认易支付方式
		confirmEpayMethod() {
			this.showEpayDialog = false
		},
		// 检测设备类型并设置相应的method参数
		detectDeviceType() {
			// #ifdef H5
			this.epayParams.method = 'web' // H5环境使用web
			this.isWechatMP = false
			// #endif

			// #ifdef MP-WEIXIN
			this.epayParams.method = 'jsapi' // 微信小程序环境使用jsapi
			this.isWechatMP = true
			// #endif

			// #ifdef MP-ALIPAY
			this.epayParams.method = 'jsapi' // 支付宝小程序环境使用jsapi
			this.isWechatMP = false
			// #endif

			// #ifdef APP-PLUS
			this.epayParams.method = 'web' // APP环境使用app
			this.isWechatMP = false
			// #endif

			console.log('当前设备类型:', this.epayParams.method)
		}
	}
}
</script>

<style scoped>
page {
	background-color: #f5f5f5;
}

.one {
	margin-top: 20rpx;
	width: 710rpx;
	height: 213rpx;
	background: url('https://www.sqkjkj.vip/wxImg/orderlist/img3.png') no-repeat;
	background-size: 100% 100%;
}

.bgc {
	background: #F4F4F4;
}

.bgc1 {
	background: #FFF2F2;
	border: 1rpx solid #FC3533;
}

.error {
	width: 74rpx;
	height: 160rpx;
	background: url('https://www.sqkjkj.vip/wxImg/common/home/img12.png') no-repeat;
	background-size: 100% 100%;
}

.ones {
	width: 503rpx;
	height: 883rpx;
	background: url('https://www.sqkjkj.vip/wxImg/mybag/img5.png') no-repeat;
	background-size: 100% 100%;
}

/* 易支付选择弹窗样式 */
.epay-dialog {
	background-color: #fff;
	padding: 30rpx;
}

.epay-dialog-title {
	font-size: 32rpx;
	font-weight: bold;
	text-align: center;
	margin-bottom: 30rpx;
}

.epay-dialog-content {
	padding: 20rpx 0;
}

.epay-payment-option {
	display: flex;
	align-items: center;
	padding: 20rpx 0;
	border-bottom: 1rpx solid #f5f5f5;
}

.radio-button {
	width: 36rpx;
	height: 36rpx;
	border-radius: 50%;
	border: 2rpx solid #ddd;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 20rpx;
}

.radio-inner {
	width: 20rpx;
	height: 20rpx;
	border-radius: 50%;
	background-color: transparent;
}

.radio-selected {
	background-color: #3298FD;
}

.payment-icon {
	margin-right: 20rpx;
}

.payment-name {
	font-size: 28rpx;
}

.epay-dialog-footer {
	display: flex;
	justify-content: space-between;
	margin-top: 40rpx;
}

.epay-dialog-btn {
	width: 45%;
	height: 80rpx;
	border-radius: 40rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28rpx;
}

.cancel-btn {
	background-color: #f5f5f5;
	color: #666;
}

.confirm-btn {
	background-color: #3298FD;
	color: #fff;
}
</style>
